package com.aaa.docter.controller.api;

import com.aaa.docter.service.HospitalService;

import com.aaa.docter.vo.HosVo;
import com.aaa.entity.HisPatient;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//患者库

@RestController
@RequestMapping("/doctor/patient")
public class ApiHospitalController {

    @Autowired
    private HospitalService hospitalService;

//   患者库的 患者信息查询
    @PostMapping("getAllPatient/{currentPage}/{pageSize}")
    public Result<IPage<HisPatient>>listPage(
            @PathVariable Integer currentPage,
            @PathVariable Integer pageSize,
            @RequestBody HosVo hosVo
    ){
        return hospitalService.getByPage(currentPage,pageSize,hosVo);
    }

//  患者库---  查询患者所有病历信息
    @GetMapping("/ById/{patientId}")
    public Result<HisPatient>list(@PathVariable String patientId){
        return hospitalService.getAll(patientId);
    }






}
